package com.github.catvod.spider.merge;

import com.github.catvod.spider.merge.HZ;

/* loaded from: classes.dex */
public class w2 extends ND {
    public w2(String str, String str2, String str3) {
        R2.u(str);
        R2.u(str2);
        R2.u(str3);
        q("name", str);
        q("publicId", str2);
        q("systemId", str3);
        HU();
    }

    private void HU() {
        if (ap("publicId")) {
            q("pubSysKey", "PUBLIC");
        } else if (ap("systemId")) {
            q("pubSysKey", "SYSTEM");
        }
    }

    private boolean ap(String str) {
        return !ZG.oC(j(str));
    }

    public void M(String str) {
        if (str != null) {
            q("pubSysKey", str);
        }
    }

    @Override // com.github.catvod.spider.merge.fa
    void Og(Appendable appendable, int i, HZ.Tw tw) {
        if (tw.Qy() != HZ.Tw.EnumC0010Tw.html || ap("publicId") || ap("systemId")) {
            appendable.append("<!DOCTYPE");
        } else {
            appendable.append("<!doctype");
        }
        if (ap("name")) {
            appendable.append(" ").append(j("name"));
        }
        if (ap("pubSysKey")) {
            appendable.append(" ").append(j("pubSysKey"));
        }
        if (ap("publicId")) {
            appendable.append(" \"").append(j("publicId")).append('\"');
        }
        if (ap("systemId")) {
            appendable.append(" \"").append(j("systemId")).append('\"');
        }
        appendable.append('>');
    }

    @Override // com.github.catvod.spider.merge.fa
    public String PU() {
        return "#doctype";
    }

    @Override // com.github.catvod.spider.merge.fa
    void R(Appendable appendable, int i, HZ.Tw tw) {
    }

    @Override // com.github.catvod.spider.merge.ND, com.github.catvod.spider.merge.fa
    public /* bridge */ /* synthetic */ String h(String str) {
        return super.h(str);
    }

    @Override // com.github.catvod.spider.merge.ND, com.github.catvod.spider.merge.fa
    public /* bridge */ /* synthetic */ String j(String str) {
        return super.j(str);
    }

    @Override // com.github.catvod.spider.merge.ND, com.github.catvod.spider.merge.fa
    public /* bridge */ /* synthetic */ fa n() {
        return super.n();
    }

    @Override // com.github.catvod.spider.merge.ND, com.github.catvod.spider.merge.fa
    public /* bridge */ /* synthetic */ String oC() {
        return super.oC();
    }

    @Override // com.github.catvod.spider.merge.ND, com.github.catvod.spider.merge.fa
    public /* bridge */ /* synthetic */ fa q(String str, String str2) {
        return super.q(str, str2);
    }

    @Override // com.github.catvod.spider.merge.ND, com.github.catvod.spider.merge.fa
    public /* bridge */ /* synthetic */ int u() {
        return super.u();
    }
}
